export function useSummaryHook() {
  const summaryOption = reactive({
    summaryData: null
  })

  function getSummariesData(data) {
    summaryOption.summaryData = data || {}
  }

  function getSummaries(param) {
    const {columns} = param
    const sums = []
    columns.forEach((column, index) => {
      sums[index] = summaryOption.summaryData ? summaryOption.summaryData[column.property] : ''
    })
    return sums
  }

  return {
    summaryOption, getSummariesData, getSummaries
  }
}
